package ronglei.heima.day01;

public class Demo01For {
    public static void main(String[] args){
//        正序
        for(int i = 1; i <= 5; i++){
            System.out.println(i);
        }
//        倒叙
        for(int a = 5; a >= 1; a--){
            System.out.println(a);
        }
//        求和
        int sum = 0;
        for (int b = 5; b >=1; b--){
            sum += b;
        }
        System.out.println(sum);
//        求一到一百所有偶数的和
        int sum100 =  0;
        for (int i = 0; i <= 100; i++) {
            if(i % 2 ==0 ){
                sum100 += i;
            }
        }
        System.out.println(sum100);
//        水仙花数
        for (int i = 100; i <= 999 ; i++) {
            int ge = i % 10 ;
            int shi = i/10 % 10;
            int bai = i/100 % 10;
            if(ge*ge*ge + shi*shi*shi + bai*bai*bai == i){
                System.out.println(i);
            }
        }
//        跳出一次循环
        for (int i = 0; i <=22 ; i++) {
            if(i== 4) continue;
            System.out.println(i);
        }
//        终止循环
        for (int i = 0; i <3 ; i++) {
            if(i == 2) break;
            System.out.println("laile");
        }


    }
}
